package com.itheima.d4_print_stream;

import java.io.PipedWriter;
import java.io.PrintStream;
import java.io.PrintWriter;

/*
  目标：了解下输出语句的重定向。
 */
public class PrintTest2 {
    public static void main(String[] args) {
        try {
            PrintStream pw = new PrintStream("qqcom.txt");
            System.setOut(pw);
            int[] arr = {12, 0, 36};
            System.out.println(arr[3]);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(e);
        }
    }

}
